<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="姓名" prop="name">
        <el-input
          v-model="queryParams.name"
          placeholder="请输入姓名"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="证件编号" prop="credentialsNo">
        <el-input
          v-model="queryParams.credentialsNo"
          placeholder="请输入证件编号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!-- <el-form-item label="届" prop="jb">
        <el-input
          v-model="queryParams.jb"
          placeholder="请输入届"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="学院" prop="college">
        <el-input
          v-model="queryParams.college"
          placeholder="请输入学院名称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="专业" prop="profession">
        <el-input
          v-model="queryParams.profession"
          placeholder="请输入专业"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="infoList" :row-class-name="tableRowClassName" @selection-change="handleSelectionChange">
      <el-table-column label="姓名" align="center" prop="name" />
      <el-table-column label="证件编号" align="center"  prop="credentialsNo" />
      <el-table-column label="性别" align="center" prop="sex" />
      <el-table-column label="文化程度" align="center" prop="education" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-search"
            @click="handleShowDetail(scope.row)"
            v-hasPermi="['system:info:edit']"
          >详情</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="handlearchives(scope.row)"
            v-hasPermi="['system:info:remove']"
          >档案详情</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <el-dialog
      :title="title"
      :visible.sync="open"
      width="1000px"
      append-to-body
    >
      <el-tabs v-model="activeName">
        <el-tab-pane label="基本信息" name="first">
          <el-form ref="form" :model="form" :rules="rules" label-width="80px">
            <el-col :span="12">
              <el-form-item label="姓名" prop="name">
                <el-input v-model="form.name" placeholder="请输入姓名" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="证件类型" prop="credentialsType">
                <el-input
                  v-model="form.credentialsType"
                  placeholder="请输入证件类型"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="证件编号" prop="credentialsNo">
                <el-input
                  v-model="form.credentialsNo"
                  placeholder="请输入证件编号"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="性别代码" prop="sex">
                <el-input v-model="form.sex" placeholder="请输入性别代码" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="生日" prop="birthday">
                <el-input v-model="form.birthday" placeholder="请输入生日" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="民族代码" prop="nation">
                <el-input v-model="form.nation" placeholder="请输入民族代码" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="籍贯代码" prop="native">
                <el-input v-model="form.native" placeholder="请输入籍贯代码" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="入团日期" prop="leagueTime">
                <el-input
                  v-model="form.leagueTime"
                  placeholder="请输入入团日期"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="入党日期" prop="partyTime">
                <el-input
                  v-model="form.partyTime"
                  placeholder="请输入入党日期"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="文化程度" prop="education">
                <el-input
                  v-model="form.education"
                  placeholder="请输入文化程度"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="政治面貌" prop="politicalOutlook">
                <el-input
                  v-model="form.politicalOutlook"
                  placeholder="请输入政治面貌"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="职业类别" prop="jobType">
                <el-input v-model="form.jobType" placeholder="请输入职业类别" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="户口类别" prop="accountType">
                <el-input
                  v-model="form.accountType"
                  placeholder="请输入户口类别"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="考生类别" prop="candidatesType">
                <el-input
                  v-model="form.candidatesType"
                  placeholder="请输入考生类别"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="录取类别" prop="admitType">
                <el-input
                  v-model="form.admitType"
                  placeholder="请输入录取类别"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="入学时间" prop="joinTime">
                <el-input
                  v-model="form.joinTime"
                  placeholder="请输入入学时间"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="毕业时间" prop="outTime">
                <el-input v-model="form.outTime" placeholder="请输入毕业时间" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="毕业结论" prop="graduationConclusion">
                <el-input
                  v-model="form.graduationConclusion"
                  placeholder="请输入毕业结论"
                />
              </el-form-item>
            </el-col>
          </el-form>
        </el-tab-pane>
        <el-tab-pane label="联系信息" name="second">
          <el-form
            ref="contactform"
            :model="contactform"
            :rules="rules"
            label-width="80px"
          >
            <el-form-item label="QQ" prop="qq">
              <el-input v-model="contactform.qq" />
            </el-form-item>
            <el-form-item label="电子邮箱" prop="email">
              <el-input v-model="contactform.email" />
            </el-form-item>
            <el-form-item label="身份证" prop="idcard">
              <el-input v-model="contactform.idcard" />
            </el-form-item>
            <el-form-item label="手机号" prop="phoneNo">
              <el-input v-model="contactform.phoneNo" />
            </el-form-item>
            <el-form-item label="住址" prop="address">
              <el-input v-model="contactform.address" />
            </el-form-item>
          </el-form>
        </el-tab-pane>
        <el-tab-pane label="学籍信息" name="third">
          <el-table v-loading="loading" :data="rollList" @selection-change="handleSelectionChange">
            <el-table-column label="学号" align="center" width="100" prop="studentNo" />
            <el-table-column label="学生类别" align="center" prop="studentType" />
            <el-table-column label="学院/系" align="center" width="180" prop="college" />
            <el-table-column label="专业" align="center" width="250" prop="profession" />
            <el-table-column label="生源所在地" align="center" width="200" prop="examineePlace" />
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-search"
                  @click="handleShowroll(scope.row)"
                  v-hasPermi="['system:info:edit']"
                >详情</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
        <el-tab-pane label="就业信息" name="five">
          <el-form
            ref="employform"
            :model="employform"
            :rules="rules"
            label-width="150px"
          >
            <el-form-item label="就业单位" prop="employUnit">
              <el-input
                v-model="employform.employUnit"
                placeholder="请输入就业单位"
              />
            </el-form-item>
            <el-form-item label="就业单位所在地" prop="employAddress" >
              <el-input
                v-model="employform.employAddress"
                placeholder="请输入就业单位所在地"
              />
            </el-form-item>
            <el-form-item label="就业单位行业" prop="employIndustry">
              <el-input
                v-model="employform.employIndustry"
                placeholder="请输入就业单位行业"
              />
            </el-form-item>
            <el-form-item label="单位性质" prop="employNature">
              <el-input
                v-model="employform.employNature"
                placeholder="请输入单位性质"
              />
            </el-form-item>
            <el-form-item label="职位类别" prop="postion">
              <el-input
                v-model="employform.postion"
                placeholder="请输入职位类别"
              />
            </el-form-item>
          </el-form>
        </el-tab-pane>
      </el-tabs>
      <div slot="footer" class="dialog-footer">
        <el-button @click="cancel">关 闭</el-button>
      </div>
    </el-dialog>

    <el-dialog
      :title="title"
      :visible.sync="rollformDiolog"
      width="1000px"
      append-to-body
    >
      <el-form
            ref="rollform"
            :model="rollform"
            :rules="rules"
            label-width="120px"
          >
            <el-form-item prop="studentPhoto" >
              <img :src="rollform.studentPhoto" class="avatar" id="studentPhotoImg" style="margin-left:30%;width:220px;height:290px;"/>
            </el-form-item>
            <el-col :span="12">
              <el-form-item label="学生类别" prop="studentType">
                <el-input v-model="rollform.studentType" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="学制" prop="eduSystem">
                <el-input v-model="rollform.eduSystem" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="入学就读学校">
                <el-input
                  v-model="rollform.startSchool"
                  placeholder="请输入入学就读学校"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="学院/系" prop="college">
                <el-input v-model="rollform.college" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="专业" prop="profession">
                <el-input v-model="rollform.profession" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="就读学历" prop="degree">
                <el-input v-model="rollform.degree" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="就读学历代码" prop="degreeNo">
                <el-input v-model="rollform.degreeNo" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="就读学位" prop="science">
                <el-input v-model="rollform.science" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="就读学位代码" prop="scienceNo">
                <el-input v-model="rollform.scienceNo" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="学位类型" prop="scienceType">
                <el-input v-model="rollform.scienceType" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="学习方式" prop="studyType">
                <el-input v-model="rollform.studyType" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="学习方式代码" prop="studyTypeNo">
                <el-input v-model="rollform.studyTypeNo" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="培养方式" prop="cultureType">
                <el-input v-model="rollform.cultureType" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="培养方式代码" prop="cultureTypeNo">
                <el-input v-model="rollform.cultureTypeNo" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="班级" prop="class">
                <el-input v-model="rollform.classes" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="入学年度" prop="admissionTime">
                <el-input v-model="rollform.admissionTime" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="学号" prop="studentNo">
                <el-input v-model="rollform.studentNo" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="成绩单" prop="studentGrades">
                <el-input
                  v-model="rollform.studentGrades"
                  placeholder="请输入成绩单"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="毕业证书号" prop="graduationNo">
                <el-input
                  v-model="rollform.graduationNo"
                  placeholder="请输入毕业证书号"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="学位证书号" prop="diploma">
                <el-input
                  v-model="rollform.diploma"
                  placeholder="请输入学位证书号"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="考生号" prop="examineeNo">
                <el-input
                  v-model="rollform.examineeNo"
                  placeholder="请输入考生号"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="生源所在地" prop="examineePlace">
                <el-input
                  v-model="rollform.examineePlace"
                  placeholder="请输入生源所在地"
                />
              </el-form-item>
            </el-col>
          </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="detailcancel">关 闭</el-button>
      </div>
    </el-dialog>
    

    <!--  多个档案信息详情展示框  -->
    <el-dialog
      :title="title"
      :visible.sync="archivesopen"
      width="1500px"
      append-to-body
    >
      <el-tabs v-model="activeName">
        <el-tab-pane label="招生类" name="first">
          <el-table v-loading="loading" :data="recruitsList" @selection-change="handleSelectionChange">
            <el-table-column label="姓名" align="center" prop="xm" class-name="fixed-width"/>
            <el-table-column label="身份证号" align="center"  prop="sfzh" class-name="fixed-width"/>
            <el-table-column label="考生号" align="center" prop="ksh" class-name="fixed-width"/>
            <el-table-column label="学号" align="center" class-name="fixed-width" prop="xh" />
            <el-table-column label="报名号" align="center" class-name="fixed-width" prop="bmh" />
            <el-table-column label="类别" align="center" class-name="fixed-width" prop="lb" />
            <el-table-column label="省份" align="center" prop="sf" />
            <el-table-column label="录取专业" align="center" class-name="fixed-width" prop="lqzy" />
            <el-table-column label="档号" align="center" class-name="fixed-width" prop="dh" />
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-view"
                  @click="RecruitView(scope.row)"
                  v-hasPermi="['system:recruits:remove']"
                >查看原文</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
        <el-tab-pane label="毕业证书类" name="second">
          <el-table v-loading="loading" :data="certificatesiList" @selection-change="handleSelectionChange">
            <el-table-column label="姓名" align="center" prop="xm" />
            <el-table-column label="考生号" align="center" class-name="fixed-width" prop="ksh" />
            <el-table-column label="学号" align="center" class-name="fixed-width" prop="xh" />
            <el-table-column label="报名号" align="center" class-name="fixed-width" prop="bmh" />
            <el-table-column label="学院" align="center" class-name="fixed-width" prop="xy" />
            <el-table-column label="专业" align="center" class-name="fixed-width" prop="zy" />
            <el-table-column label="毕业时间" align="center" prop="bysj" />
            <el-table-column label="档号" align="center" class-name="fixed-width" prop="dh" />
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-view"
                  @click="CertificatesiView(scope.row)"
                  v-hasPermi="['system:certificatesi:remove']"
                >查看原文</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
        <el-tab-pane label="学籍成绩单类信息" name="third">
          <el-table v-loading="loading" :data="scoreinfoList" @selection-change="handleSelectionChange">
            <el-table-column label="姓名" align="center" prop="xm" />
            <el-table-column label="考生号" align="center" class-name="fixed-width" prop="ksh" />
            <el-table-column label="学号" align="center" class-name="fixed-width" prop="xh" />
            <el-table-column label="报名号" align="center" class-name="fixed-width" prop="bmh" />
            <el-table-column label="类别" align="center" prop="lb" />
            <el-table-column label="学院" align="center" prop="xy" />
            <el-table-column label="专业" align="center" prop="zy" />
            <el-table-column label="入学时间" align="center" prop="rxsj" />
            <el-table-column label="毕业证号" align="center" prop="byzh" class-name="fixed-width"/>
            <el-table-column label="档号" align="center" prop="dh" class-name="fixed-width"/>
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-view"
                  @click="ScoreinfoView(scope.row)"
                  v-hasPermi="['system:scoreinfo:remove']"
                >查看原文</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
        <el-tab-pane label="就业派遣类信息" name="five">
          <el-table v-loading="loading" :data="employmentinfoList" @selection-change="handleSelectionChange">
            <el-table-column label="姓名" align="center" prop="xm" />
            <el-table-column label="考生号" align="center" class-name="fixed-width" prop="ksh" />
            <el-table-column label="学号" align="center" class-name="fixed-width" prop="xh" />
            <el-table-column label="报名号" align="center" class-name="fixed-width" prop="bmh" />
            <el-table-column label="类别" align="center" prop="lb" />
            <el-table-column label="专业" align="center" prop="zy" />
            <el-table-column label="学历" align="center" prop="xl" />
            <el-table-column label="接收单位" align="center" prop="jsdw" />
            <el-table-column label="档号" align="center" prop="dh" />
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-view"
                  @click="EmployView(scope.row)"
                  v-hasPermi="['system:employmentinfo:remove']"
                >查看原文</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
      </el-tabs>
      <div slot="footer" class="dialog-footer">
        <el-button @click="cancel">关 闭</el-button>
      </div>
    </el-dialog>

    <el-dialog
      :title="ViewArchivestitle"
      :visible.sync="ViewArchivesDiolog"
      width="1000px"
      append-to-body
    >
      <vue-viewer multiple
       :thumb="imageList"
       list-ul-class="image-list"
       :full="imageList">
       <!--在列表中加入右上角删除按钮-->
       <template slot-scope="target">
       </template>
      </vue-viewer>
      <div slot="footer" class="dialog-footer">
        <el-button @click="ViewArchivesclose">关 闭</el-button>
      </div>
    </el-dialog>

  </div>
</template>

<script>
import { listInfo, getInfo, delInfo, addInfo, updateInfo, exportInfo,ViewArchives } from "@/api/system/info";
import { getEmploy} from "@/api/system/employ";
import { getContact} from "@/api/system/contact";
import { listRoll,getRoll} from "@/api/system/roll";

import { listRecruits, getRecruits, delRecruits, addRecruits, updateRecruits, exportRecruits } from "@/api/system/recruits";
import { listCertificatesi, getCertificatesi, delCertificatesi, addCertificatesi, updateCertificatesi, exportCertificatesi } from "@/api/system/certificatesi";
import { listScoreinfo, getScoreinfo, delScoreinfo, addScoreinfo, updateScoreinfo, exportScoreinfo } from "@/api/system/scoreinfo";
import { listEmploymentinfo, getEmploymentinfo, delEmploymentinfo, addEmploymentinfo, updateEmploymentinfo, exportEmploymentinfo } from "@/api/system/employmentinfo";
export default {
  name: "Info",
  components: {
  },
  data() {
    return {
      //资源存储地址
      dataurl:"http://localhost:8080/AllData",
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      rollListtotal:0,
      // 校友基本数据集合
      infoList: [],
      //学籍信息集合
      rollList: [],
      imageList: [],
      // 弹出层标题
      title: "",
      ViewArchivestitle:"",
      // 是否显示弹出层
      open: false,
      rollformDiolog: false,
      archivesopen:false,
      ViewArchivesDiolog:false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        name: null,
        credentialsType: null,
        credentialsNo: null,
        sex: null,
        birthday: null,
        nation: null,
        native: null,
        leagueTime: null,
        partyTime: null,
        education: null,
        politicalOutlook: null,
        linkrecno: null,
        student_type:null,
        college:null,
        profession:null,
        jb:null,
        alumneId:null
      },
      rollqueryParams: {
        pageNum: 1,
        pageSize: 10,
        name: null,
        jb:null,
        alumneId:null
      },
      ArchivesqueryParams: {
        pageNum: 1,
        pageSize: 10,
        name: null,
        jb:null,
        linkrecno: null,
        alumneId:null
      },
      query: {
        url: null
      },
      activeName: "first",
      // 表单参数
      form: {},
      contactform: {},
      employform: {},
      rollform: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    //表格隔行变色
    tableRowClassName({row, rowIndex}) {
      if ((rowIndex+1) % 2  === 0) {
          return 'success-row';
      }
      return '';
    },
    /** 查询【请填写功能名称】列表 */
    getList() {
      this.loading = true;
      listInfo(this.queryParams).then(response => {
        this.infoList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.archivesopen = false;
      this.reset();
    },
    ViewArchivesclose() {
      this.ViewArchivesDiolog = false;
    },
    // 表单重置
    reset() {
      this.form = {
        alumneId: null,
        lbcode: null,
        name: null,
        credentialsType: null,
        credentialsNo: null,
        sex: null,
        birthday: null,
        nation: null,
        native: null,
        leagueTime: null,
        partyTime: null,
        education: null,
        politicalOutlook: null,
        linkrecno: null
      };
      this.resetForm("form");
    },
    detailcancel() {
      this.rollformDiolog = false;
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.alumneId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加【请填写功能名称】";
    },
    /** 查看校友数据详情操作 */
    handleShowDetail(row) {
      this.reset();
      const alumneId = row.alumneId || this.ids
      getInfo(alumneId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "查看基本信息";
      });

      getContact(alumneId).then((response) => {
        if (response.data != null) {
          this.contactform = response.data;
          console.log(this.contactform);
        }
      });
      getEmploy(alumneId).then((response) => {
        if (response.data != null) {
          this.employform = response.data;
          console.log(this.employform);
        }
      });
      this.rollqueryParams.alumneId = alumneId
      listRoll(this.rollqueryParams).then(response => {
        this.rollList = response.rows;
        this.rollListtotal = response.total;
        this.loading = false;
      });
    },
    //查看单个学籍信息
    handleShowroll(row) {
      const alumneId = row.id || this.ids
      getRoll(alumneId).then((response) => {
        if (response.data != null) {
          response.data.studentPhoto =
            "data:image/bmp;base64," + response.data.studentPhoto;
          this.rollform = response.data;
          this.rollformDiolog = true;
          this.title = "查看学籍信息";
        }
      });
    },
    //recruitsDetail查看单个招生类档案详情
    recruitsDetail(row) {
      this.reset();
      const recno = row.recno || this.ids
      getCertificatesi(recno).then(response => {
        this.recruitsform = response.data;
        this.recruitsopen = true;
        this.title = "招生档案详情";
      });
    },
    //查询个人档案信息
    handlearchives(row) {
      this.reset();
      const linkrecno = row.linkrecno || this.ids
      //招生
      this.ArchivesqueryParams.linkrecno = linkrecno
      listRecruits(this.ArchivesqueryParams).then(response => {
        this.recruitsList = response.rows;
        this.loading = false;
        this.archivesopen = true;
        this.title = "个人档案信息";
      });
      //毕业证书
      listCertificatesi(this.ArchivesqueryParams).then((response) => {
          this.certificatesiList = response.rows;
          this.loading = false;
      });
      //成绩单类
      listScoreinfo(this.ArchivesqueryParams).then((response) => {
          this.scoreinfoList = response.rows;
          this.loading = false;
      });
      //就业派遣类
      listEmploymentinfo(this.ArchivesqueryParams).then(response => {
        this.employmentinfoList = response.rows;
        this.loading = false;
      });
    },
    //判断文件是否存在
    isExistFile(url)  
    {      
        var xmlHttp ;  
        if (window.ActiveXObject)  
         {  
          xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");  
         }  
         else if (window.XMLHttpRequest)  
         {  
          xmlHttp = new XMLHttpRequest();  
         }   
        xmlHttp.open("GET",url,false);  
        xmlHttp.send();  
        if(xmlHttp.readyState==4){
            if(xmlHttp.status==200){
              return true;
            }//url存在
            else{
              return false;
            }
        }else{
          return false;
        }
        return false;
    },
    // 查看档案图片
    RecruitView(row) {
      var pages = this.trsformPage(row.sPage,6);
      var dh = this.dataurl+"\\"+ row.dh+"\\"+pages+".jpg";
      var flag = this.isExistFile(dh);
      if(!flag){
        dh = this.dataurl+"\\"+ row.dh+"\\"+pages+".tif";
      }
      this.ViewArchivesDiolog = true;
      this.ViewArchivestitle = "原文查看";
      this.imageList.pop();
      this.queryParams.nation = dh
      ViewArchives(this.queryParams).then((response) => {
        if (response.msg != null) {
          this.imageList.push("data:image/bmp;base64," + response.msg);
          this.queryParams.nation = null;
        }
      });
    },
    ScoreinfoView(row) {
      var pages = this.trsformPage(row.sPage,6);
      var dh = this.dataurl+"\\"+ row.dh+"\\"+pages+".jpg";
      var flag = this.isExistFile(dh);
      if(!flag){
        dh = this.dataurl+"\\"+ row.dh+"\\"+pages+".tif";
      }
      this.ViewArchivestitle = "原文查看";
      this.imageList.pop();
      this.ViewArchivesDiolog = true;
      this.queryParams.nation = dh
      ViewArchives(this.queryParams).then((response) => {
        if (response.msg != null) {
          this.imageList.push("data:image/bmp;base64," + response.msg);
          this.queryParams.nation = null;
        }
      });
    },
    EmployView(row) {
      var pages = this.trsformPage(row.sPage,6);
      var dh = this.dataurl+"\\"+row.dh+"\\"+pages+".jpg";
      var flag = this.isExistFile(dh);
      if(!flag){
        dh = this.dataurl+"\\"+ row.dh+"\\"+pages+".tif";
      }
      this.ViewArchivestitle = "原文查看";
      this.imageList.pop();
      this.ViewArchivesDiolog = true;
      this.queryParams.nation = dh
      ViewArchives(this.queryParams).then((response) => {
        if (response.msg != null) {
          this.imageList.push("data:image/bmp;base64," + response.msg);
          this.queryParams.nation = null;
        }
      });
    },
    CertificatesiView(row) {
      var pages = this.trsformPage(row.sPage,6);
      var dh = this.dataurl+"\\"+row.dh+"\\"+pages+".jpg";
      var flag = this.isExistFile(dh);
      if(!flag){
        dh = this.dataurl+"\\"+ row.dh+"\\"+pages+".tif";
      }
      this.ViewArchivestitle = "原文查看";
      this.imageList.pop();
      this.ViewArchivesDiolog = true;
      this.queryParams.nation = dh
      ViewArchives(this.queryParams).then((response) => {
        if (response.msg != null) {
          this.imageList.push("data:image/bmp;base64," + response.msg);
          this.queryParams.nation = null;
        }
      });
    },
    trsformPage(num, length) {
        for(var len = (num + "").length; len < length; len = num.length) {
            num = "0" + num;            
        }
        return num;
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.alumneId != null) {
            updateInfo(this.form).then(response => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addInfo(this.form).then(response => {
              this.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const alumneIds = row.alumneId || this.ids;
      this.$confirm('是否确认删除【请填写功能名称】编号为"' + alumneIds + '"的数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return delInfo(alumneIds);
        }).then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        })
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm('是否确认导出所有【请填写功能名称】数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return exportInfo(queryParams);
        }).then(response => {
          this.download(response.msg);
        })
    }
  }
};
</script>
<style rel="stylesheet/scss" lang="scss">
.el-table .success-row {
    background: #F3F3F3;
}
.image-list{
  margin: 0; padding: 0
}
.image-list li {
  display: inline-block;
  margin: 0 10px;
  list-style: none;
  position: relative;
}
.image-list li img {
  box-shadow: 0 0 5px #333;
}
</style>